<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div class="outer">
        <button id="updateRealm">update</button>
    </div>
    <script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
    <script src="/public/scripts/base.js"></script>
    <script>
        $(function(){
            //更新服务器列表
            $("#updateRealm").click(function(){
                $.ajax({
                    url:"/{$URL_PREFIX}wow/getrealms",
                    type:"post",
                    success:function(data){
                        if(data.status == 1) alert("更新成功");
                    },
                    error:function(){
                       alert("网络错误");
                    }
                });
            });
            var realmList = JSON.parse('{$realmList}');
            for(var i in realmList.realms){
                $(".outer").append('<p>'+ realmList.realms[i].name +'</p>');
            }
        });
    </script>
</body>
</html>